<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>last选择器</title>
		<style>
			*{
				font-size: 14px;
				font-family: "微软雅黑";
			}
			
			ul{
				list-style: none;
			}
			
			ul li{
				width: 100px;
				height: 50px;
				line-height: 50px;
				background-color: #CCC;
				text-align: center;
				color: white;
			}
			
			ul li:hover{
				cursor: pointer;
				background-color: #ef5b00;
			}
			
			input[type=button]{
				background-color: #ef5b00;
				color: white;
				height: 30px;
				line-height: 30px;
				text-align: center;
				display: block;
				cursor: pointer;
				font-size: 12px;
				width: 250px;
				font-family: "微软雅黑";
				/*去掉边框的关键代码*/
				border: 0 none;
				
			}
			
			.red{
				background-color: #ef5b00;
				font-weight: bold;
			}
			
		</style>
	</head>
	<body>
		
		蜀国之五虎上将：
		<ul>
			<li>关羽</li>
			<li>张飞</li>
			<li>赵云</li>
			<li>马超</li>
			<li>黄忠</li>
		</ul>
		<input type="button" onclick="search();" value="==匹配五虎上将之尾==" />
	</body>
	
	<!--Step1:导入jquery-->
	<script type="text/javascript" src="../../../js/jquery-1.4.1.js" ></script>
	<script>
		function search(){
			var element = $("ul li:last");
			element.addClass("red");
			console.log(element.html());
		}
	</script>
</html>

<!--
	作者：offline
	时间：2016-05-26
	描述： :frist语法总结：
	
	1：从多个中选择第1个
-->

